#include <iostream>
#include <algorithm>
#include <functional>
#include <thread>
#include <vector>

using namespace std;

static void afficher(int i) {
	cout << i << endl;
}

int main(int argc, char** argv) {
	vector<thread> v;
	for (int i = 0; i < 10; i++) {
		v.push_back(thread(afficher, i));
	}
	for_each(v.begin(), v.end(), mem_fn(&thread::join));
	return 0;
}

